#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
int main()
{
	int n;
	scanf("%d",&n);
	while(n--)
	{
		int a,b;
		scanf("%d %d",&a,&b);
		if(a<b)
		{
			int t = a;
			a = b;
			b = t;
		}
		int k = 2*b;
		int ans = max(a,k);
		printf("%d\n",ans*ans);
	}
} 
